package com.huluobo.base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import androidx.room.Upsert
import com.huluobo.base.bean.LoginBean

/**
 *  Created by LC on 2024/7/26.
 */
@Dao
interface UserDao {
    @Upsert //功能包含了insert和update,如果插入的对象和之前的相等,就会 直接更新掉,与之前的替换,形式一致
    suspend fun insertUserInfo(loginBean: LoginBean)

    @Delete
    suspend fun deleteUserInfo(loginBean: LoginBean)

    @Update
    suspend fun updateUserInfo(loginBean: LoginBean)

    @Query("select * from user_info where uName=:username")
    suspend fun queryUserInfo(username: String): LoginBean
}